<template>
  <!-- 区域 1-7 景区-采摘 -->
  <div>
    <div v-for="a in menuNav" :key="a.id">
      <div v-if="a.id == $route.query.id">
        <div v-if="$route.query.label == '景区'">
          <div v-for="b in a[$route.query.title]" :key="b.id">
            <top-nav>
              <div class="div-top">{{ $route.query.label }}</div>
            </top-nav>
            <img class="img" :src="b.img1" alt="" />
            <!-- 搜索框 -->
            <Input-nav class="input"></Input-nav>
            <div class="box">
              <div class="box1">
                <router-link :to="{ name: b.name, query: { uname: b.uname } }">
                  <img :src="b.img" alt="" /></router-link>
                <div>
                  <div class="top">
                    <span>{{ b.label }}</span>
                    <div>
                      <span class="span1">{{ b.money }}</span>
                      <span class="span2">{{ b.span }}</span>
                    </div>
                  </div>
                  <div class="bottom">
                    <img src="../assets/地址555@3x.png" alt="" />
                    <span>{{ b.site }}</span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div v-else>
          <div v-for="b in a[$route.query.title]" :key="b.id">
            <top-nav>
              <div class="div-top">{{ $route.query.label }}</div>
            </top-nav>
            <img class="img" :src="b.img1" alt="" />
            <!-- 搜索框 -->
            <Input-nav class="input"></Input-nav>
            <div class="all">
              <router-link :to="{ name: b.name, query: { uname: b.uname } }">
                <img class="img2" :src="b.img" alt="" />
              </router-link>
              <div class="qwe-1">
                <div class="qwe-top">
                  <span>{{ b.label }}</span>
                  <img class="img2" src="../assets/商户@3x.png" alt="" />
                </div>
                <div class="qwe-concent">{{ b.site }}</div>
                <div class="qwe-bottom">
                  <span>{{ b.span }}</span>
                  <a>{{ b.money }}</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getScenery } from '@/api/scenery';

export default {
  data() {
    return {
      menuNav: [],
    };
  },
  created() {
    this.getScenery();
  },
  methods: {
    async getScenery() {
      const { data } = await getScenery();
      this.menuNav = data;
    },
  },
};
</script>

<style lang="scss" scoped>
.div-top {
  font-size: 17px;
  color: #333333;
  letter-spacing: 0;
  text-align: center;
  line-height: 44px;
}

.img {
  width: 375px;
  height: 150px;
}

.input {
  margin-top: -40px;
}

.box {
  width: 375px;
  display: flex;
  justify-content: center;
  margin-top: 20px;

  .box1 {
    background: #ffffff;
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    width: 345px;
    height: 264px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;

    img {
      width: 315px;
      height: 168px;
      border-radius: 4px;
    }

    >div {
      .top {
        width: 315px;
        display: flex;
        justify-content: space-between;

        >span {
          font-size: 18px;
          color: #333333;
          letter-spacing: 0;
        }

        div {
          .span1 {
            color: #e52f17;
            font-size: 17px;
          }

          .span2 {
            font-size: 12px;
            color: #151515;
          }
        }
      }

      .bottom {
        width: 315px;
        margin-top: 10px;

        img {
          width: 15px;
          height: 16px;
        }

        span {
          font-size: 14px;
          color: #bbbbbb;
        }
      }
    }
  }
}

.all {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  width: 345px;
  height: 120px;
  margin: 0 auto;
  margin-top: 10px;
  margin-bottom: 20px;

  .img2 {
    width: 90px;
    height: 90px;
  }

  .qwe-1 {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 10px;
    height: 90px;
    width: 204px;

    .qwe-top {
      span {
        font-size: 17px;
        color: #333333;
      }

      img {
        width: 34px;
        height: 16px;
      }
    }

    .qwe-concent {
      font-size: 12px;
      color: #bbbbbb;
    }

    .qwe-bottom {
      span {
        font-size: 12px;
        color: #333333;
      }

      a {
        color: #e52f17;
        font-size: 17px;
      }
    }
  }
}</style>
